//Sprite mixin, works perfectly with standard defines
@mixin use-sprite($sprite, $map, $map-2x) {
    background-image: sprite-url($map);
    background-position: sprite-position($map, $sprite);
    background-repeat: no-repeat;
    overflow: hidden;
    display: block;
    height: image-height(sprite-file($map, $sprite));
    width: image-width(sprite-file($map, $sprite));

    @media (-webkit-min-device-pixel-ratio: 2), (-o-min-device-pixel-ratio: 3/2), (min--moz-device-pixel-ratio: 2), (min-device-pixel-ratio: 2), (min-resolution: 144dppx) {
        background-image: sprite-url($map-2x);
        background-size: (image-width(sprite-path($map-2x)) / 2) (image-height(sprite-path($map-2x)) / 2);
        background-position: round(nth(sprite-position($map-2x, $sprite), 1) / 2) round(nth(sprite-position($map-2x, $sprite), 2) / 2);
        height: image-height(sprite-file($map-2x, $sprite)) / 2;
        width: image-width(sprite-file($map-2x, $sprite)) / 2;
    }
}

@mixin all-sprites-retina($map, $map-2x){
  $name: sprite-map-name($map);
  @each $sprite in sprite-names($map) {
    .#{$name}-#{$sprite}{
      @include use-sprite($sprite, $map, $map-2x);
    }
  }
}
// 使用
// $provider_sprite: sprite-map("sprites/provider/*.png");
// $provider_sprite-2x: sprite-map("sprites-2x/provider/*.png");
// @include all-sprites-retina($provider_sprite, $provider_sprite-2x);